package com.dumian.apple.testtoast;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button mButton= (Button) findViewById(R.id.button_1);
        mButton.setOnClickListener(new View.OnClickListener(){
            /**
             * makeText(Context,"文本显示内容"，Toast显示的时间长短).show();
             * */
            @Override
            public void onClick(View v){
                Toast.makeText(MainActivity.this,"We Clicked this Button1",Toast.LENGTH_SHORT).show();
            }
        });

    }


}
